home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Commodore Disk User Volume 3 #7
/
Commodore_Disk_User_Vol.3_7_1990_-.d64
/
hires animator
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
4KB
|
122 lines
10 ifa>0then40
20 poke55,255:poke56,63:poke51,255:poke52,63:clr
30 a=a+1:print"loading sprites":load"sprite file 1",8,1
40 ifa>1then60
50 a=a+1:print"loading m/code ":load"animate.mc",8,1
60 ifa>2then90
70 sys 50222:rem clear bit map memory and hires character memory
80 a=a+1:print"loading hires ch":load"test1 .anm",8,1
90 gosub 820:rem variables
100 syscls:syscmem:syssbank:sysschbase
110 poke53265,peek(53265)or32:rem hires bit map mode
120 ifpeek(multi)=1thenpoke53270,peek(53270)or16:rem multicolour
130 poke24568,0:poke24569,8:rem sprite pointers
140 poke53276,peek(53276)or3:rem multi colour sprite
150 poke53287,10:poke53285,12:poke53286,5:poke53288,0:rem sprite colour
160 poke53248,100:poke53249,50:rem x,y co-ordinates
170 poke53264,peek(53264)or1:rem msb of sprite 0
180 poke53269,peek(53269)or3:rem switch on sprites
190 sysinit:rem set up hires figure on screen
200 sc=0:db=0
210 pokemode,108:sysanim
220 rem main loop
230 forn=0to320
240 sx=sx-1
250 if sx<0and(peek(53264)and1)=1thengosub760
260 if sx=0and(peek(53264)and1)=0thensx=100:poke53264,1
270 if db=0thensc=sc+1
280 if db=1thensc=sc-1
290 if sc=0thendb=0
300 if sc=7thendb=1
310 poke53248,sx:poke24568,sc
320 nextn
330 poke53269,0:sysaoff
340 pokecb,96:pokect,128:syswipe
350 poke multi,1:pokeabase,0:pokeabase+1,96
360 k=60
370 x=1/(NULL):p=0
380 a=1/sqr(5)
390 forn=1 to 1000
400 y=x-.5:x=x+a-int(x+a)
410 p=p-y
420 xx=x*319:yy=100-p*k:cc=int(rnd(1)*3+1)
430 xx=2*int(xx/2):xh=int(xx/256):xl=xx-(xh*256)
440 pokecolour,cc:pokehx,xl:pokehx+1,xh:pokehy,yy
450 sysplot
460 nextn
470 poke mode,96
480 gosub670:pv=1:pokepause,pv:pokeyd,0
490 x1=(peek(px)*8)+60:y1=150:poke53250,x1:poke53251,y1
500 sx=100:poke53264,1:poke53248,sx:poke53249,120:poke53269,3
510 sysnanim
520 sx=sx-1
530 if sx<0and(peek(53264)and1)=1thengosub760
540 if sx=0and(peek(53264)and1)=0thensx=100:poke53264,1
550 if db=0thensc=sc+1
560 if db=1thensc=sc-1
570 if sc=0thendb=0
580 if sc=7thendb=1
590 ifpeek(fire)=1then650
600 poke53248,sx:poke24568,sc
610 x1=(peek(px)*8)+60
620 ifx1>255thenx1=x1-255:poke53264,peek(53264)or2:poke53250,x1:goto640
630 ifx1<255thenpoke53264,peek(53264)and253:poke53250,x1
640 goto510
650 poke53269,0
660 end
670 rem initialise character routine
680 poke mve,0:poke rile,0
690 x=8:y=8:rem coordinates (in character blocks) of start position.
700 pokepx,x:pokepy,y
710 ss=24576+(320*y):pokehl,int(ss/256):pokell,ss-(peek(hl)*256):rem extreme lhs
720 pokehr,int((ss+240)/256):pokelr,(ss+240)-(peek(hr)*256):rem extreme rhs
730 ss=ss+(8*x):pokesvlue+1,int(ss/256):pokesvlue,ss-(int(ss/256)*256)
740 sys aer
750 return
760 rem msb off
770 sx=255:poke53264,peek(53264)and 254
780 return
790 rem msb on
800 sx(0)=0:poke53264,peek(53264)or1
810 return
820 rem initialise variables
830 sbank=49205:rem set bank
840 schbase=49224:rem set char.base
850 rile=49916:rem moving l-r or r-l
860 mve=49917:rem character move
870 multi=49152:rem multi colour mode
880 init=49362:rem initialise hires character routine
890 anim=49450:rem animation routine
900 pause=50192:rem slow routine value location
910 cls=49235:rem set colour memory
920 cmem=49246:rem clear memory(colour)location
930 dx=49359:rem direction of x joystick
940 dy=49360:rem direction of y joystick
950 fire=49361:rem fire button pressed
960 ll=49918:rem left hand side lo.byte
970 lr=49920:rem right hand side lo.byte
980 hl=49919:rem left hand side hi.byte
990 hr=49921:rem right hand side hi.byte
1000 pv=16:rem pause value
1010 cb=254:rem bottom of memory clear vector hi byte
1020 ct=50236:rem top of memory hi byte
1030 px=49924:rem position of x
1040 py=49925:rem position of y
1050 yd=49926:rem switch on movement in y axis
1060 pokeyd,1
1070 abase=51290:rem hires screen vector
1080 erase=50981:rem erase hires pixel
1090 colour=50982:rem multi colour colour
1100 hx=50983:rem hires pixel x
1110 hy=50985:rem hires pixel y
1120 plot=50901:rem plot hires pixel
1130 wipe=49297:rem clear hires memory
1140 aoff=49475:rem switch off interrupt driven character
1150 nanim=49490:rem non interrupt driven hires character
1160 mode=49711:rem pokemode,108 before using interrupt character otherwise 96
1170 aloop=49837:rem routine to ex-or 80*96 pixel block of memory
1180 aste=49890:rem routine to store start variables of block move
1190 aer=49714:rem routine to set standing figure
1200 svlue=49912:rem screen position of character.
1210 return